package util

import (
	"net/http"
	"strings"
)

//从http request cookie获取机器指纹
func GetFingerPrint(request *http.Request) (fg string) {
	cookieValue := request.Header.Values("Cookie")
	if len(cookieValue) >= 1 {
		cookies := strings.Split(cookieValue[0], ";")
		for _, cookie := range cookies {
			if strings.Contains(cookie, "immortal") {
				fg = strings.Split(cookie, "=")[1]
				return
			}
		}
	}
	return ""
}

